import {CodeError, Http, HttpBuilder} from "mvx-foundation";
import {WXHttp} from "./WXHttp";

export function WXHttpBuilderCreator(enableRealtimeLog = false): (baseUrl: string) => HttpBuilder {
  return baseUrl => {
    let builder = new class extends HttpBuilder {
      build(): Http {
        return new WXHttp(this, enableRealtimeLog)
      }
    };
    return builder.setBaseUrl(baseUrl)
  }
}
